
-------- Stylesheet creation and updating in Conception v3 -------

Tom Conlon, 15th March 2007

INTRODUCTION

File/Save_special/Save_styles contains commands for creating and updating stylesheets. 

As the names suggest, updating is a less radical operation. It can alter the appearance of a style but cannot alter the topology (child-parent relationships) of a map. This command is 'safe' in that changes will not alter the appearance of existing Conception maps.

UPDATING

Caution: updating a stylesheet may affect subsequent editing of any map that uses this stylesheet. The map's appearance will not change (ie on File/Open) but future extensions to the map will use the new version of the stylesheet, e.g. new nodes will reflect any colour and font changes to the stylesheet.

To update a stylesheet, eg 'Concept map' or 'Argument map', the recommended procedure is :-

1) Use File/Open to open the file 'stylesheet_source.xml' in the stylesheet's folder (this is always a subfolder of the Styles folder). You will have to set the dialog's Filter control to view documents of type XML -- the default of course is set to view '.cpn' files. This gives a map window containing a representation of the stylesheet's source map.

2) Edit the window graphically as required. 

3) File/Save_special/Save_styles/Update to permanently update the stylesheet. Note that only stylesheet.pl is revised by this process. You are recommended also to save your window as a new version of stylesheet_source.xml, by use of the File/Save_special/Save_XML command. This will keep the xml file consistent with stylesheet.pl (although this is not crucial since only stylesheet.pl is consulted at runtime).

4) The revised stylesheet can be immediately accessed by selecting its name in the File/New dialog.
   

CREATION

Caution: creating a stylesheet is not recommended for inexpert users, since map topology must be correctly defined and inept creation could overwrite existing stylesheets or prevent existing Conception maps of that style from opening and/or behaving correctly. Hence this command is protected by a setting in the Runtime/plprsrcs/defaults/PC/Conception_application_defaults.txt file. The setting is named 'enable_stylesheet_creation' - change its value to @on and the Create command will become accessible on future Conception runs.
 
To create a stylesheet based on a window W of pre-existing style WS :-

1) Create a window W of style WS. Edit it so that it exhibits the required styles, including parent-child node relationships as well as visible styles. Inspect some examples of files of name 'stylesheet_source.xml' to see how this should be done. Note that the stylesheet that will be created from W will require user-selection of a label from a popup menu in two circumstances: a) where W shows that a node's style may have two or more distinct exiting arc labels, and b) where W shows that a node's style may have two or more distinct child node labels. Stylesheet 'decision_map.pl' illustrates a), stylesheet 'writing_plan.pl' illustrates b), and stylesheet 'argument_map.pl' illustrates a) and b) combined.

2) Use File/Save_special/Save_styles/New stylesheet. Supply a name SSN for the new stylesheet. If SSN is a name that is already in use as a stylesheet name, the old stylesheet will be overwritten.

3) SSN is now immediately available in the File/New dialog for creating new windows of that style.

4) The result of the above is a folder Styles/SSN that contains a file stylesheet.pl. When Conception is launched, it uses this file to define the incorporated styles.  

5) It is useful (but not necessary) to generate a file stylesheet_source.xml that reproduces the contents of the original window W in a way that enables the stylesheet to be updated by graphical editing, as described above (see Updating). Unfortunately, you cannot generate this file simply by saving W in XML format. This is because W has styles that are defined by reference to the original stylesheet WS. Instead, use File/New to create a window using the new stylesheet SSN. Manually reproduce in it the contents of window W (the original window). Then use File/Save_special/Save_styles/New stylesheet on that window, reusing the name SSN for the saved stylesheet. Finally, restart Conception, create a new window with style SSN, again manually reproduce in it the contents of window W, and save this as stylesheet_source.xml using File/Save_special/Save_XML. This is how the stylesheet_source.xml files provided with Conception were initially generated.

